import React, { memo } from 'react';
import { SearchVideoWrapper } from './style';
import {formatDuration} from '@/utils/format'
export default memo(function SearchVideo(props) {
  const {list} = props
  return (
    <SearchVideoWrapper>
      {
        list.map(item => {
          return (
            <div className="item" key={item.vid}>
              <img src={item.coverUrl} alt="" />
              <div className="name text-nowrap">{item.title}</div>
              <div className="dt">{formatDuration(item.durationms)}</div>
              <div className="creator">{item.creator[0].userName}</div>
            </div>
          )
        })
      }
    </SearchVideoWrapper>
  )
});
